﻿@{
    Layout = "";
}
@model Giant.Plugin.Widgets.BaiduAnalytics.Models.ConfigurationModel
@using Giant.Web.Framework;

@Html.Action("SiteScopeConfiguration", "Setting", new { area = "Admin" })

@{
////default values
//var trackingScript = Html.Raw(HttpUtility.JavaScriptStringEncode("<!-- Baidu code for Analytics tracking -->" + "\r\n" +
//    "<script>" +
//        "var _hmt = _hmt || [];" +
//        "(function() {" +
//            "var hm = document.createElement('script');" +
//            "hm.src = 'https://hm.baidu.com/hm.js?{CODE}';" +
//            "var s = document.getElementsByTagName('script')[0];" +
//            "s.parentNode.insertBefore(hm, s);" +
//            "})();" +
//    "</ script > "
//    ));
}



@using (Html.BeginForm())
{
    @Html.AntiForgeryToken()
    <div class="panel-group">
        <div class="panel panel-default">
            <div class="panel-body">
                <p>
                    百度站点统计
                    <br />
                    <br />
                    配置向导:<br />
                    <ul>
                        <li>
                            <a href="http://tongji.baidu.com/" target="_blank">创建账号</a> 
                            ，并配置需要统计的站点，生成代码。
                        </li>
                        <li>把生成的代码复制到本页的跟踪代码输入框</li>
                        <li>点击保存后，在列表页中将插件状态设置为启用，百度统计就被集成到本网站</li>
                    </ul>
                    <br/>
                </p>
            </div>
        </div>
        <div class="panel panel-default">
            <div class="panel-body">
                <div class="form-group">
                    <div class="col-md-3">
                        @Html.OverrideSiteCheckboxFor(model => model.TrackingScript_OverrideForSite, model => model.TrackingScript, Model.ActiveSiteScopeConfiguration)
                        @Html.ExtLabelFor(model => model.TrackingScript)
                    </div>
                    <div class="col-md-9">
                        @Html.ExtTextAreaFor(model => model.TrackingScript)
                        @Html.ValidationMessageFor(model => model.TrackingScript)
                    </div>
                </div>

                <div class="form-group">
                    <div class="col-md-3">
                        @Html.ExtLabelFor(model => model.ZoneId)
                    </div>
                    <div class="col-md-9">
                        @Html.ExtDropDownListFor(model => model.ZoneId, Model.AvailableZones)
                        @Html.ValidationMessageFor(model => model.ZoneId)
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-md-3">
                        &nbsp;
                    </div>
                    <div class="col-md-9">
                        <input type="submit" name="save" class="btn bg-blue" value="@T("Admin.Common.Save")" />
                    </div>
                </div>
            </div>
        </div>
    </div>
}